import * as api from '../../util/api';
import http from '../../util/http';
import axios from 'axios'

const state ={
    accountId:'',//账号id
};
const actions={
    capitalAccountPageList({commit},obj){
        console.log(obj)
        return http({
            url:api.messageCapitalAccount,
            method:'post',
            data:obj
        }).then(resp=>{
            console.log(resp.data)
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    capitalAccountPageSelect({commit},obj){
        console.log(obj)
        return axios({
            url:api.selectCapitalAccount,
            method:'post',
            data:obj
        }).then(resp=>{
            console.log(resp.data)
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    capitalAccountPageTopUpLis({commit},obj){
        console.log(obj)
        return http({
            url:api.messageTopUpCapitalAccount,
            method:'post',
            data:obj
        }).then(resp=>{
            console.log(resp.data)
            //commit('setAccountId',resp.data.data)
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    capitalAccountPageTopUp({commit},obj){
        console.log(obj)
        return http({
            url:api.topUpCapitalAccount,
            method:'post',
            data:obj
        }).then(resp=>{
            console.log(resp.data)
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    }
};
const mutations ={
    // setAccountId(state,obj){
    //
    // }
};
const getters ={

};
export default{
    state,
    actions,
    mutations,
    getters
}